home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_util / bsrc_260.zip / INCLUDE.ZIP / COM_OS2.H < prev    next >
C/C++ Source or Header  |  1996-03-27  |  6KB  |  123 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*              (C) Copyright 1987-96, Bit Bucket Software Co.              */
  11. /*                                                                          */
  12. /*            This header file was written by Peter Fitzsimmons             */
  13. /*                                                                          */
  14. /*             OS/2 Communications definitions for BinkleyTerm              */
  15. /*                                                                          */
  16. /*                                                                          */
  17. /*    For complete  details  of the licensing restrictions, please refer    */
  18. /*    to the License  agreement,  which  is published in its entirety in    */
  19. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.260.    */
  20. /*                                                                          */
  21. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  22. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  23. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  24. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  25. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  26. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  27. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  28. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  29. /*                                                                          */
  30. /*                                                                          */
  31. /* You can contact Bit Bucket Software Co. at any one of the following      */
  32. /* addresses:                                                               */
  33. /*                                                                          */
  34. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  35. /* P.O. Box 460398                AlterNet 7:42/1491                        */
  36. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  37. /*                                Internet f491.n343.z1.fidonet.org         */
  38. /*                                                                          */
  39. /* Please feel free to contact us at any time to share your comments about  */
  40. /* our software and/or licensing policies.                                  */
  41. /*                                                                          */
  42. /*--------------------------------------------------------------------------*/
  43.  
  44. /* Baud rate masks */
  45.  
  46. #define BAUD_300        300
  47. #define BAUD_1200        1200
  48. #define BAUD_2400        2400
  49. #define BAUD_4800        4800
  50. #define BAUD_9600        9600
  51. #define BAUD_19200        19200
  52. #define BAUD_38400        38400
  53. #define BAUD_57600        57600
  54. #define BAUD_115200        115200
  55.  
  56. unsigned Cominit (int, int);
  57. void MDM_DISABLE (void);
  58. void MDM_ENABLE (unsigned long);
  59.  
  60. typedef unsigned char bool;
  61.  
  62. extern void com_XON_enable (void);
  63. extern void com_XON_disable (void);
  64. extern void com_DTR_on (void);
  65. extern void com_DTR_off (void);
  66. extern void com_break (int on);
  67. extern int com_getc (int);
  68.  
  69. extern void MDM_ENABLE (unsigned long rate);
  70. extern void MDM_DISABLE (void);
  71. unsigned Cominit (int port, int failsafe);
  72. extern int get_key (void);
  73. extern USHORT ComTXBlockTimeout (BYTE *lpBuf, USHORT cbBuf, ULONG ulTimer);
  74. extern USHORT ComTXRemain (void);
  75.  
  76. /* translate binkley fossil stuff to my async package */
  77.  
  78. #define CARRIER                (ComIsOnline(hcModem))
  79. #define CHAR_AVAIL()        ComInCount(hcModem)
  80. #define OUT_EMPTY()            (ComOutCount(hcModem)==0)
  81. #define OUT_FULL()            (ComOutSpace(hcModem)==0)
  82. #define LOWER_DTR()            com_DTR_off()
  83. #define RAISE_DTR()            com_DTR_on()
  84. #define CLEAR_OUTBOUND()    ComPurge(hcModem, COMM_PURGE_TX)
  85. #define CLEAR_INBOUND()        ComPurge(hcModem, COMM_PURGE_RX)
  86. #define KEYPRESS()            kbhit()
  87. #define READKB()            get_key()
  88. #define FOSSIL_CHAR()        get_key()
  89. #define XON_ENABLE()        com_XON_enable()
  90. #define IN_XON_ENABLE()
  91. #define XON_DISABLE()        com_XON_disable()
  92. #define _BRK_DISABLE()
  93. #define FOSSIL_WATCHDOG(x)
  94. #define SENDBYTE(c)            ComPutc(hcModem, c)
  95. #define BUFFER_BYTE(c)        ComPutc(hcModem, c)
  96. #define UNBUFFER_BYTES()    ComTxWait(hcModem, 1L)    /* yield cpu for a moment*/
  97. #define MODEM_IN()            ComGetc(hcModem)
  98. #define WRITE_ANSI(c)        putch (c)
  99. #define PEEKBYTE()            ComPeek(hcModem)
  100. #define do_break(on)        com_break(on)
  101. #define SENDCHARS(buf, size, carcheck)    ComWrite(hcModem, buf, (USHORT)size)
  102. #define hfComHandle            ComGetFH(hcModem)
  103.  
  104. #define real_flush(fh)        DosBufReset((HFILE)fh)
  105.  
  106. /* some useful bits */
  107.  
  108. #define RLSD    0x80        /* (MSR) Received line signal detect */
  109.                             /* sometimes called Carrier Detect */
  110.  
  111. #define THRE    0x20        /* (LSR) Transmitter holding register empty */
  112.                             /* (ready for another byte) */
  113.  
  114. #define DR        0x1            /* (LSR) Data ready indicator */
  115.  
  116. #define OE        0x2            /* (LSR) Overrun error! We are not reading */
  117.                             /* bytes fast enuf */
  118.  
  119. void ShowMdmSettings (void);
  120.  
  121. /* END OF FILE: com_os2.h */
  122.  
  123.